assert_that(p.cargo_process("build").arg("--target").arg(&target)
.arg("-v"),
execs().with_status(101)
- .with_stderr(&format!("\
+ .with_stderr_contains(&format!("\
[COMPILING] foo v0.5.0 ({url})
[RUNNING] `rustc src[..]foo.rs --crate-name foo --crate-type bin -g \
--out-dir {dir}[..]target[..]{target}[..]debug \
let host_output = format!("\
[COMPILING] foo v0.0.0 ({foo})
[RUNNING] target[..]foo-[..]
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-
[DOCTEST] foo
-
-running 1 test
-test _0 ... ok
-
-test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
-
", foo = p.url());
+ println!("a");
assert_that(p.cargo_process("test"),
execs().with_status(0)
- .with_stdout(&host_output));
+ .with_stderr(&host_output));
+ println!("b");
let target = host();
assert_that(p.cargo_process("test").arg("--target").arg(&target),
execs().with_status(0)
- .with_stdout(&host_output));
+ .with_stderr(&host_output));
+ println!("c");
let target = alternate();
assert_that(p.cargo_process("test").arg("--target").arg(&target),
execs().with_status(0)
.with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({foo})
-[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target))
- .with_stdout("
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-
-"));
+[RUNNING] target[..]{triple}[..]foo-[..]
+", foo = p.url(), triple = target)));
});
test!(simple_cargo_run {
assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(101)
- .with_stderr("\
-[..] error: can't find crate for `d2`[..]
-[..] extern crate d2;
-[..]
-error: aborting due to previous error
-[ERROR] Could not compile `d1`.
-
-Caused by:
- [..]
-"));
+ .with_stderr_contains("\
+[..] error: can't find crate for `d2`[..]"));
});
test!(platform_specific_variables_reflected_in_build_scripts {
dir = p.root().display(), url = p.url())));
});
-test!(build_lib_and_allow_unstable_options {
+test!(lib {
let p = project("foo")
.file("Cargo.toml", r#"
[package]
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("--lib").arg("-v")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions=off"),
execs()
.with_status(0)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
- -Z unstable-options \
+ -C debug-assertions=off \
--out-dir {dir}{sep}target{sep}debug \
--emit=dep-info,link \
-L dependency={dir}{sep}target{sep}debug \
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("-v").arg("--bin").arg("foo")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(0)
.with_stderr(&format!("\
-L dependency={dir}{sep}target{sep}debug \
-L dependency={dir}{sep}target{sep}debug{sep}deps`
[RUNNING] `rustc src{sep}main.rs --crate-name {name} --crate-type bin -g \
- -Z unstable-options \
+ -C debug-assertions \
--out-dir {dir}{sep}target{sep}debug \
--emit=dep-info,link \
-L dependency={dir}{sep}target{sep}debug \
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("-v")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(101)
.with_stderr(CARGO_RUSTC_ERROR));
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("-v").arg("--bin").arg("bar")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(0)
.with_stderr(format!("\
[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
--out-dir {dir}{sep}target{sep}debug [..]`
[RUNNING] `rustc src{sep}bin{sep}bar.rs --crate-name bar --crate-type bin -g \
- -Z unstable-options [..]`
+ -C debug-assertions [..]`
", sep = SEP,
dir = p.root().display(), url = p.url())));
});
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("-v")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(101)
.with_stderr(CARGO_RUSTC_ERROR));
.file("src/lib.rs", r#" "#);
assert_that(p.cargo_process("rustc").arg("-v").arg("--test").arg("bar")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(0)
.with_stderr(format!("\
[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
--out-dir {dir}{sep}target{sep}debug [..]`
[RUNNING] `rustc tests{sep}bar.rs --crate-name bar --crate-type bin -g \
- -Z unstable-options [..]--test[..]`
+ -C debug-assertions [..]--test[..]`
", sep = SEP,
dir = p.root().display(), url = p.url())));
});
"#);
bar.build();
- assert_that(foo.cargo_process("rustc").arg("-v").arg("--").arg("-Z").arg("unstable-options"),
+ assert_that(foo.cargo_process("rustc").arg("-v").arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(0)
.with_stderr(format!("\
[COMPILING] bar v0.1.0 ([..])
[RUNNING] `[..] -g -C [..]`
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `[..] -g -Z unstable-options [..]`
+[RUNNING] `[..] -g -C debug-assertions [..]`
",
url = foo.url())));
});
bar.build();
assert_that(foo.cargo_process("rustc").arg("-v").arg("-p").arg("bar")
- .arg("--").arg("-Z").arg("unstable-options"),
+ .arg("--").arg("-C").arg("debug-assertions"),
execs()
.with_status(0)
.with_stderr("\
[COMPILING] bar v0.1.0 ([..])
-[RUNNING] `[..]--crate-name bar --crate-type lib [..] -Z unstable-options [..]`
+[RUNNING] `[..]--crate-name bar --crate-type lib [..] -C debug-assertions [..]`
"));
});